Account = {
    balance = 0,
    deposit = function (v)
    self.balance = self.balance + v
    end
}
-- 错误用法 (使用了全局table)
-- function Account.withdraw(v)
--     Account.balance = Account.balance - v
-- end
-- .写法
-- function Account.withdraw(self,v)
--     self.balance = self.balance - v
-- end
-- Account.withdraw(Account,100)

-- :写法 无需显式传对象 
function Account:withdraw(v)
    self.balance = self.balance - v
end
Account:withdraw(10)
print(Account.balance)